# -*- coding: utf-8 -*-
"""
@Time    : 2025/3/1 14:16
@Author  : ZhangShenao
@File    : draw_analyze_table.py
@Desc    :
"""

import pandas as pd

# 定义统计数据
data = {
    'Category': [
        'sexual', 'violence', 'sexual/minors', 'self-harm',
        'self-harm/intent', 'harassment/threatening', 'hate',
        'self-harm/instructions', 'hate/threatening'
    ],
    'Count': [3875, 543, 375, 19, 9, 8, 8, 2, 1],
    'Average Score': [0.9670, 0.8838, 0.5421, 0.6320, 0.5735, 0.8519, 0.5588, 0.1834, 0.1308]
}

# 创建DataFrame
df = pd.DataFrame(data)

# 按照Count数量降序排序
df_sorted = df.sort_values(by='Count', ascending=False)

# 生成表格
print(df_sorted[['Category', 'Count', 'Average Score']].to_string(index=False))
